package org.springcloud.wisdom.springcloud_03_freshman.student.service;

import org.springcloud.wisdom.springcloud_03_freshman.student.dao.DormitoryDao;
import org.springcloud.wisdom.springcloud_03_freshman.student.entity.Dormitory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class DormitoryService {
    @Autowired
    DormitoryDao dormitoryDao;

    /**
     * 根据id查宿舍详情
     * @param id
     * @return
     */
    public Dormitory getDormitoryById(Integer id){
        if (id==null || id <0){
            return null;
        }
        return dormitoryDao.getDormitory(id);
    }
}
